<style>
    .nav-tabs{
        border-bottom: unset;
    }
    .progress-bar {
        color: #020202;
        background-image: linear-gradient(to right, #4969e6, #1ac6f2);
    }
</style>
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="row content" style="padding: 0px;">
        <div class="panel-group" id="accordion">
            <div class="panel panel-success">
                <div class="panel-heading">
                    <h4 class="panel-title">

                        <small style="margin-left: 10px;" class=" label bg-purple">总消费：{$row.purchase_total}</small>
                        <small style="margin-left: 10px;" class=" label bg-blue">下单：{$row.purchase_times}次</small></label>
                        <small style="margin-left: 10px;" class=" label bg-green">
                            {php}
                            $deal_time= \addons\facrm\library\Helper::timeTran($row['deal_time']);
                            echo  $deal_time?$deal_time.'下单':'无下单';
                            {/php}
                        </small></label>

                        <span class="label label-primary pull-right">
                            <a href="#" style="color: #ffffff" onclick="javascript:parent.Fast.api.open('facrm/customer/index/edit/ids/{$row.id}',__('修改客户信息-')+'{$row.name}');"> {:__('修改')}</a>
                        </span>
						{if($auth->check('facrm/customer/project/index'))}
						<span class="label label-danger pull-right" style="margin-right: 10px;">
                            <a href="javascript:void(0);" data-url="{$row.project_link}" data-area="['98%','98%']" class="btn-addtabs" data-original-title="{:__('项目-')}{$row.name}" data-title="{:__('项目-')}{$row.name}" style="color: #FFFFFF">{:__('项目')}</a>
                        </span>
						{/if}
                    </h4>
                </div>
                <div id="collapseOne" class="panel-collapse collapse in">
                    <div class="panel-body">

                        <div class="form-group col-md-6 col-xs-12">
                            <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('客户名称')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                <div class="input-group">
                                    <input id="c-name"  style="border-right: unset" data-rule="required" type="text" class="form-control" name="row[name]" value="{$row.name|htmlentities}"  />
                                    <div class="input-group-addon " style="border-left: unset">
                                        <span>ID：{$row.id}</span>
                                    </div>
                                </div>
                            </div>
                        </div>
						<div class="form-group col-md-6 col-xs-12">
                            <label class="control-label col-xs-12 col-sm-2">{:__('服务阶段')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                {:build_select('row[follow_status]', $followStatusList,$row.follow_status, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
                            </div>
                        </div>

						<div class="form-group col-md-6 col-xs-12">
                            <label class="control-label col-xs-12 col-sm-2">{:__('负责人')}:</label>
                            <div class="col-xs-12 col-sm-8">
								<input id="c-owner_user_id" data-rule="required" data-source="facrm/common/selectpage/model/admin" data-field="nickname" data-primary-key="id" class="form-control selectpage" name="row[owner_user_id]" type="text" value="{$row.owner_user_id}"   >
                            </div>
                        </div>
						<div class="form-group col-md-6 col-xs-12">
                            <label class="control-label col-xs-12 col-sm-2">{:__('助教')}:</label>
                            <div class="col-xs-12 col-sm-8">
								<input id="c-owner_user_ids" data-source="facrm/common/selectpage/model/admin" data-field="nickname" data-primary-key="id" data-multiple="true" class="form-control selectpage" name="row[owner_user_ids]" type="text" value="{$row.owner_user_ids}"   >
                            </div>
                        </div>

                        <div class="form-group col-md-6 col-xs-12">
                            <label for="c-telephone" class="control-label col-xs-12 col-sm-2">{:__('联系电话')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                <div class="input-group">
                                    <input id="c-telephone" class="form-control" size="50" name="row[telephone]" type="text" value="{$row.telephone}"  >
                                    <div class="input-group-addon no-border no-padding">
                                        <span>
                                            <button type="button"  class="btn btn-success cloudcall" data-type="customer" data-field="telephone" data-typeid="{$row.id}" data-name="{$row.name}"
                                            ><i class="fa fa-phone"></i> {:__('云呼')}</button></span>

                                    </div>
                                </div>
                            </div>


                        </div>

                        <div class="form-group col-md-6 col-xs-12">
                            <label for="c-mobile" class="control-label col-xs-12 col-sm-2">{:__('联系手机')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                <div class="input-group">
                                    <input id="c-mobile" class="form-control" size="50" name="row[mobile]" type="text" value="{$row.mobile}"  >
                                    <div class="input-group-addon no-border no-padding">
                                        <span>
                                            <button type="button"  class="btn btn-success cloudcall" data-type="customer" data-field="mobile" data-typeid="{$row.id}" data-name="{$row.name}"
                                            ><i class="fa fa-phone"></i> {:__('云呼')}</button></span>

                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="form-group col-md-6 col-xs-12">
                            <label class="control-label col-xs-12 col-sm-2">{:__('关注度')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                {:build_select('row[level]', $levelList,$row.level, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
                            </div>
                        </div>
                        <!--<div class="form-group col-md-6 col-xs-12">
                            <label class="control-label col-xs-12 col-sm-2">{:__('客户行业')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                {:build_select('row[industry]', $industryList, $row.industry, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
                            </div>
                        </div>-->
                        <div class="form-group col-md-6 col-xs-12">
                            <label class="control-label col-xs-12 col-sm-2">{:__('客户来源')}:</label>
                            <div class="col-xs-12 col-sm-8">
                               {:build_select('row[source]', $sourceList, $row.source, ['class'=>'form-control selectpicker', 'data-rule'=>'required'])}
                                  
							</div>
                        </div>
                        <!--<div class="form-group col-md-6 col-xs-12">
                            <label for="c-tags" class="control-label col-xs-12 col-sm-2">{:__('客户标签')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input id="c-tags" data-rule="" class="form-control" placeholder="输入后空格确认" name="row[tags]" type="text" value="{$row.tags}">
                                <span class="text-gray">输入后空格确认</span>
                            </div>
                        </div>-->
                        <div class="form-group col-md-6 col-xs-12">
                            <label for="c-address" class="control-label col-xs-12 col-sm-2">地址:</label>
                            <div class="col-xs-12 col-sm-8">
                                <div class="form-inline" data-toggle="cxselect" data-selects="province,city,area">
                                    <select class="province form-control" name="province" data-url="ajax/area">
                                        <option value="{$row.province}" selected=""></option>
                                    </select>
                                    <select class="city form-control" name="city" data-url="ajax/area">
                                        <option value="{$row.city}" selected=""></option>
                                    </select>
                                    <select class="area form-control" name="area" data-url="ajax/area">
                                        <option value="{$row.area}" selected=""></option>
                                    </select>
                                </div>
                            </div>
                        </div>

                        <div class="form-group col-md-6 col-xs-12">
                            <label for="c-detail_address" class="control-label col-xs-12 col-sm-2">详细地址:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input id="c-detail_address" type="text" class="form-control" name="row[detail_address]" value="{$row.detail_address}"  />
                            </div>
                        </div>

                        <div class="form-group col-md-6 col-xs-12">
                            <label for="c-service" class="control-label col-xs-12 col-sm-2">当前服务:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input id="c-service" type="text"  class="form-control" name="row[service]" value="{$row.service}"  />
                            </div>
                        </div>
                        <div class="form-group col-md-6 col-xs-12">
                            <label for="c-keynote" class="control-label col-xs-12 col-sm-2">近期重点:</label>
                            <div class="col-xs-12 col-sm-8">
                                <input id="c-keynote" type="text"  class="form-control" name="row[keynote]" value="{$row.keynote}"  />
                            </div>
                        </div>

                        <div class="form-group col-md-6 col-xs-12">
                            <label for="c-remark" class="control-label col-xs-12 col-sm-2">{:__('基本情况')}:</label>
                            <div class="col-xs-12 col-sm-8">
                                <textarea id="c-remark" class="form-control editor" name="row[remark]">{$row.remark}</textarea>
                            </div>
                        </div>


                    </div>
                </div>
            </div>


            <div class="panel panel-info">
                <div class="panel-heading">
                    <h4 class="panel-title">
                        <a data-toggle="collapse"
                           href="#collapseThree">
                            {:__('资料扩展')}
                        </a>
                    </h4>
                </div>
                <div id="collapseThree" class="panel-collapse collapse in">
                    <div class="panel-body">
                        <div id="extend"></div>

                    </div>
                </div>
            </div>


        </div>



        {include file="facrm/customer/index/tables" /}


    </div>




					    
	{if !isset($action)}
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
    {/if}
</form>
<script>
    var customer_id={:input('ids')};
    var record_type_list={:json_encode($record_type_list)};
    var jobs_obj={:json_encode($w_config_jobs)};
</script>




